home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-09-28 | 1.6 KB | 56 lines |
- /*
- * QuickTime for Java SDK Sample Code
-
- Usage subject to restrictions in SDK License Agreement
- * Copyright: © 1996-1999 Apple Computer, Inc.
-
- */
- import java.awt.event.*;
- import java.awt.*;
-
- import quicktime.*;
- import quicktime.app.image.*;
- import quicktime.app.display.*;
-
- public class SlideShow extends ImageViewer implements MouseListener {
- //_________________________ CLASS METHODS
- public SlideShow (ImageSequencer images) throws QTException {
- super (images);
- }
- //_________________________ INSTANCE METHODS
- /**
- * This method is called when a Drawable object is added to a canvas.
- * @param obj the QTCanvas that the drawable object is being added to.
- */
- public void addedTo (Object obj) {
- ((Component)obj).addMouseListener (this);
- }
-
- /**
- * This method is called when a Drawable object is removed a canvas.
- * @param obj the QTCanvas that the drawable object is being removed from.
- */
- public void removedFrom (Object obj) {
- ((Component)obj).removeMouseListener (this);
- }
-
- // this would be a good place to put a transition
- /** Mouse pressed events are used to change the current image */
- public void mousePressed (MouseEvent ev) {
- if ((ev.getModifiers() & InputEvent.ALT_MASK) != 0) {
- getImages().setFramePrevious();
- } else {
- getImages().setFrameNext();
- }
- try {
- setDisplayedImage (getImages().getImage(), getImages().getDescription());
- } catch (QTException e) { e.printStackTrace(); }
- }
-
- public void mouseClicked (MouseEvent e) {}
- public void mouseEntered (MouseEvent e) {}
- public void mouseExited (MouseEvent e) {}
- public void mouseReleased (MouseEvent e) {}
- }
-
-